'''
Created on Dec 3, 2010

@author: Tom Smith
'''
import lxml.objectify

class RobotData(object):
    '''
    classdocs
    '''
    x_position = None
    y_position = None
    z_position = None
    photo = None
    infrared = None
    ratio = None

    def __init__(self):
        '''
        Constructor
        '''
        
    def sortOutXML(self, xml):
        if xml[27] == 'z':
            self.processPositionXML(xml)
        else:
            print "Go sensor data"
            self.processSensorXML(xml)
    def processPositionXML(self, position_xml):
        data = lxml.objectify.fromstring(position_xml)
        #print data.x_position
        self.x_position = data.x_position
        self.y_position = data.y_position
        self.z_position = data.z_position
    def processSensorXML(self, sensor_xml):
        data = lxml.objectify.fromstring(sensor_xml)
        self.photo = data.photo
        self.infrared = data.infrared
        self.ratio = data.ratio
        
        
        
        